// @ts-ignore
/* eslint-disable */
import request from '@/request';

/** 此处后端没有提供注释 POST /answer/create */
export async function createAnswer(
  body: API.UserAnswerCreateRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean>('/answer/create', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /answer/delete */
export async function deleteAnswer(body: number, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/answer/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /answer/list */
export async function getAnswerList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getAnswerListParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseListUserAnswerVO>('/answer/list', {
    method: 'GET',
    params: {
      ...params,
      userAnswerSearchRequest: undefined,
      ...params['userAnswerSearchRequest'],
    },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /answer/update */
export async function updateAnswer(
  body: API.UserAnswerUpdateRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean>('/answer/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
